package com.cloud.mall.oms.service.impl;

import com.cloud.mall.base.BaseResponse;
import com.cloud.mall.core.bean.MallBeanUtils;
import com.cloud.mall.oms.mapper.OmsCompanyAddressMapper;
import com.cloud.mall.oms.model.OmsCompanyAddress;
import com.cloud.mall.oms.model.OmsCompanyAddressExample;
import com.cloud.mall.oms.out.OmsCompanyAddressOut;
import com.cloud.mall.oms.service.OmsCompanyAddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class OmsCompanyAddressServiceImpl  implements OmsCompanyAddressService {
    @Autowired
    private OmsCompanyAddressMapper companyAddressMapper;
    @Override
    public BaseResponse<List<OmsCompanyAddressOut>> list() {
        List<OmsCompanyAddress> omsCompanyAddresses = companyAddressMapper.selectByExample(new OmsCompanyAddressExample());
        return BaseResponse.setResultSuccess(MallBeanUtils.copyDoToDto(omsCompanyAddresses,OmsCompanyAddressOut.class));
    }
}
